<?php

namespace app\common\validate;

use think\Validate;

class Question extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        ['question_id', 'require', '传题question_id'],
        ['question_group_id', 'require', '传题question_group_id'],
        ['is_right', 'require', '传答题是否正确'],
        ['answer', 'require', '传用户答案'],
        ['question_user_answers_id', 'require', '传答题记录id']
    ];
    
    /**
     * 提示消息
     */
    protected $message = [

    ];


    /**
     * 验证场景
     */
    protected $scene = [
        'user_answers' => ['question_id', 'is_right','question_group_id'], # 提交题目
        'user_answers_edit' => ['question_user_answers_id', 'is_right', 'answer'], # 重新做题
    ];

}
